<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>CCRenderTexture Class Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.2 (build 963)" />
	</head>
	<body>
		<header id="top_header">
			<div id="library" class="hideInXcode">
				<h1><a id="libraryTitle" href="../index.html">Cocos2D </a></h1>
				<a id="developerHome" href="../index.html">3.2.0</a>
			</div>
			
			<div id="title" role="banner">
				<h1 class="hideInXcode">CCRenderTexture Class Reference</h1>
			</div>
			<ul id="headerButtons" role="toolbar">
				<li id="toc_button">
					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
				</li>
				<li id="jumpto_button" role="navigation">
					<select id="jumpTo">
	<option value="top">Jump To&#133;</option>
	
	<option value="overview">Overview</option>
	
	
	
	
	<option value="tasks">Tasks</option>
	
	
	
	
	
	<option value="properties">Properties</option>
	
	<option value="//api/name/autoDraw">&nbsp;&nbsp;&nbsp;&nbsp;autoDraw</option>
	
	<option value="//api/name/clearColor">&nbsp;&nbsp;&nbsp;&nbsp;clearColor</option>
	
	<option value="//api/name/clearDepth">&nbsp;&nbsp;&nbsp;&nbsp;clearDepth</option>
	
	<option value="//api/name/clearFlags">&nbsp;&nbsp;&nbsp;&nbsp;clearFlags</option>
	
	<option value="//api/name/clearStencil">&nbsp;&nbsp;&nbsp;&nbsp;clearStencil</option>
	
	<option value="//api/name/sprite">&nbsp;&nbsp;&nbsp;&nbsp;sprite</option>
	
	
	
	
	<option value="class_methods">Class Methods</option>
	
	<option value="//api/name/renderTextureWithWidth:height:">&nbsp;&nbsp;&nbsp;&nbsp;+ renderTextureWithWidth:height:</option>
	
	<option value="//api/name/renderTextureWithWidth:height:pixelFormat:">&nbsp;&nbsp;&nbsp;&nbsp;+ renderTextureWithWidth:height:pixelFormat:</option>
	
	<option value="//api/name/renderTextureWithWidth:height:pixelFormat:depthStencilFormat:">&nbsp;&nbsp;&nbsp;&nbsp;+ renderTextureWithWidth:height:pixelFormat:depthStencilFormat:</option>
	
	
	
	
	<option value="instance_methods">Instance Methods</option>
	
	<option value="//api/name/begin">&nbsp;&nbsp;&nbsp;&nbsp;- begin</option>
	
	<option value="//api/name/beginWithClear:g:b:a:">&nbsp;&nbsp;&nbsp;&nbsp;- beginWithClear:g:b:a:</option>
	
	<option value="//api/name/beginWithClear:g:b:a:depth:">&nbsp;&nbsp;&nbsp;&nbsp;- beginWithClear:g:b:a:depth:</option>
	
	<option value="//api/name/beginWithClear:g:b:a:depth:stencil:">&nbsp;&nbsp;&nbsp;&nbsp;- beginWithClear:g:b:a:depth:stencil:</option>
	
	<option value="//api/name/clear:g:b:a:">&nbsp;&nbsp;&nbsp;&nbsp;- clear:g:b:a:</option>
	
	<option value="//api/name/clearDepth:">&nbsp;&nbsp;&nbsp;&nbsp;- clearDepth:</option>
	
	<option value="//api/name/clearStencil:">&nbsp;&nbsp;&nbsp;&nbsp;- clearStencil:</option>
	
	<option value="//api/name/end">&nbsp;&nbsp;&nbsp;&nbsp;- end</option>
	
	<option value="//api/name/getUIImage">&nbsp;&nbsp;&nbsp;&nbsp;- getUIImage</option>
	
	<option value="//api/name/initWithWidth:height:pixelFormat:">&nbsp;&nbsp;&nbsp;&nbsp;- initWithWidth:height:pixelFormat:</option>
	
	<option value="//api/name/initWithWidth:height:pixelFormat:depthStencilFormat:">&nbsp;&nbsp;&nbsp;&nbsp;- initWithWidth:height:pixelFormat:depthStencilFormat:</option>
	
	<option value="//api/name/saveToFile:">&nbsp;&nbsp;&nbsp;&nbsp;- saveToFile:</option>
	
	<option value="//api/name/saveToFile:format:">&nbsp;&nbsp;&nbsp;&nbsp;- saveToFile:format:</option>
	
	<option value="//api/name/saveToFilePath:">&nbsp;&nbsp;&nbsp;&nbsp;- saveToFilePath:</option>
	
	<option value="//api/name/saveToFilePath:format:">&nbsp;&nbsp;&nbsp;&nbsp;- saveToFilePath:format:</option>
	
	
	
</select>
				</li>
			</ul>
		</header>
		<nav id="tocContainer" class="isShowingTOC">
			<ul id="toc" role="tree">
				
<li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li>




<li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Create CCRenderTexture.">Create CCRenderTexture.</a></span></li>
	
</ul></li>





<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#properties">Properties</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/autoDraw">autoDraw</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/clearColor">clearColor</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/clearDepth">clearDepth</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/clearFlags">clearFlags</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/clearStencil">clearStencil</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/sprite">sprite</a></span></li>
	
</ul></li>



<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#class_methods">Class Methods</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/renderTextureWithWidth:height:">renderTextureWithWidth:height:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/renderTextureWithWidth:height:pixelFormat:">renderTextureWithWidth:height:pixelFormat:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/renderTextureWithWidth:height:pixelFormat:depthStencilFormat:">renderTextureWithWidth:height:pixelFormat:depthStencilFormat:</a></span></li>
	
</ul></li>



<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/begin">begin</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/beginWithClear:g:b:a:">beginWithClear:g:b:a:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/beginWithClear:g:b:a:depth:">beginWithClear:g:b:a:depth:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/beginWithClear:g:b:a:depth:stencil:">beginWithClear:g:b:a:depth:stencil:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/clear:g:b:a:">clear:g:b:a:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/clearDepth:">clearDepth:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/clearStencil:">clearStencil:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/end">end</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/getUIImage">getUIImage</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/initWithWidth:height:pixelFormat:">initWithWidth:height:pixelFormat:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/initWithWidth:height:pixelFormat:depthStencilFormat:">initWithWidth:height:pixelFormat:depthStencilFormat:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/saveToFile:">saveToFile:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/saveToFile:format:">saveToFile:format:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/saveToFilePath:">saveToFilePath:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/saveToFilePath:format:">saveToFilePath:format:</a></span></li>
	
</ul></li>


			</ul>
		</nav>
		<article>
			<div id="contents" class="isShowingTOC" role="main">
				<a title="CCRenderTexture Class Reference" name="top"></a>
				<div class="main-navigation navigation-top">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="header">
					<div class="section-header">
						<h1 class="title title-header">CCRenderTexture Class Reference</h1>
					</div>		
				</div>
				<div id="container">	
					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<td class="specification-title">Inherits from</td>
	<td class="specification-value"><a href="../Classes/CCNode.html">CCNode</a> : <a href="../Classes/CCResponder.html">CCResponder</a> : NSObject</td>
</tr><tr>
	<td class="specification-title">Declared in</td>
	<td class="specification-value">CCRenderTexture.h</td>
</tr>
						</tbody></table></div>
					
                    
                    
					
					<div class="section section-overview">
						<a title="Overview" name="overview"></a>
						<h2 class="subtitle subtitle-overview">Overview</h2>
						<p>CCRenderTexture is a generic rendering target. To render things into it,
simply construct a render target, call <a href="#//api/name/begin">begin</a> on it, call visit on any cocos2d
scenes or objects to render them, and call <a href="#//api/name/end">end</a>. For convenience, render texture
adds a <a href="#//api/name/sprite">sprite</a> as its display child with the results, so you can simply add
the render texture to your scene and treat it like any other <a href="../Classes/CCNode.html">CCNode</a>.
There are also functions for saving the render texture to disk in PNG or JPG format.</p>
					</div>
					
					
					
					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						<h2 class="subtitle subtitle-tasks">Tasks</h2>
						
						
						
						<h3 class="subsubtitle task-title">Other Methods</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/sprite">&nbsp;&nbsp;sprite</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/clearFlags">&nbsp;&nbsp;clearFlags</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/clearColor">&nbsp;&nbsp;clearColor</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/clearDepth">&nbsp;&nbsp;clearDepth</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/clearStencil">&nbsp;&nbsp;clearStencil</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/autoDraw">&nbsp;&nbsp;autoDraw</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li>
						</ul>
						
						
						<a title="Create CCRenderTexture." name="task_Create CCRenderTexture."></a>
						<h3 class="subsubtitle task-title">Create CCRenderTexture.</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/renderTextureWithWidth:height:pixelFormat:depthStencilFormat:">+&nbsp;renderTextureWithWidth:height:pixelFormat:depthStencilFormat:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/renderTextureWithWidth:height:pixelFormat:">+&nbsp;renderTextureWithWidth:height:pixelFormat:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/renderTextureWithWidth:height:">+&nbsp;renderTextureWithWidth:height:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/initWithWidth:height:pixelFormat:">&ndash;&nbsp;initWithWidth:height:pixelFormat:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/initWithWidth:height:pixelFormat:depthStencilFormat:">&ndash;&nbsp;initWithWidth:height:pixelFormat:depthStencilFormat:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/begin">&ndash;&nbsp;begin</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/beginWithClear:g:b:a:">&ndash;&nbsp;beginWithClear:g:b:a:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/beginWithClear:g:b:a:depth:">&ndash;&nbsp;beginWithClear:g:b:a:depth:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/beginWithClear:g:b:a:depth:stencil:">&ndash;&nbsp;beginWithClear:g:b:a:depth:stencil:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/end">&ndash;&nbsp;end</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/clear:g:b:a:">&ndash;&nbsp;clear:g:b:a:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/clearDepth:">&ndash;&nbsp;clearDepth:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/clearStencil:">&ndash;&nbsp;clearStencil:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/saveToFile:">&ndash;&nbsp;saveToFile:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/saveToFile:format:">&ndash;&nbsp;saveToFile:format:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/saveToFilePath:">&ndash;&nbsp;saveToFilePath:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/saveToFilePath:format:">&ndash;&nbsp;saveToFilePath:format:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/getUIImage">&ndash;&nbsp;getUIImage</a></code>
	</span>
	
	
</li>
						</ul>
						
					</div>
					
					
					
					
					
					<div class="section section-methods">
						<a title="Properties" name="properties"></a>
						<h2 class="subtitle subtitle-methods">Properties</h2>
						
						<div class="section-method">
	<a name="//api/name/autoDraw" title="autoDraw"></a>
	<h3 class="subsubtitle method-title">autoDraw</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>When enabled, it will render its children into the <a href="#//api/name/texture">texture</a> automatically. Disabled by default for compatiblity reasons.
Will be enabled in the future.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite) BOOL autoDraw</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/clearColor" title="clearColor"></a>
	<h3 class="subsubtitle method-title">clearColor</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Clear color value. Valid only when &ldquo;autoDraw&rdquo; is YES.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, strong) CCColor *clearColor</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/clearDepth" title="clearDepth"></a>
	<h3 class="subsubtitle method-title">clearDepth</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Value for clearDepth. Valid only when <a href="#//api/name/autoDraw">autoDraw</a> is YES.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite) GLclampf clearDepth</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/clearFlags" title="clearFlags"></a>
	<h3 class="subsubtitle method-title">clearFlags</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT. They can be OR'ed. Valid when &ldquo;<a href="#//api/name/autoDraw">autoDraw</a> is YES.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite) GLbitfield clearFlags</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/clearStencil" title="clearStencil"></a>
	<h3 class="subsubtitle method-title">clearStencil</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Value for clear Stencil. Valid only when <a href="#//api/name/autoDraw">autoDraw</a> is YES</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite) GLint clearStencil</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/sprite" title="sprite"></a>
	<h3 class="subsubtitle method-title">sprite</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>The <a href="../Classes/CCSprite.html">CCSprite</a> that is used for rendering.
    A subtle change introduced in v3.1.1 is that this sprite is rendered explicitly and is not a child of the render <a href="#//api/name/texture">texture</a>.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite, strong) CCSprite *sprite</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
					
					<div class="section section-methods">
						<a title="Class Methods" name="class_methods"></a>
						<h2 class="subtitle subtitle-methods">Class Methods</h2>
						
						<div class="section-method">
	<a name="//api/name/renderTextureWithWidth:height:" title="renderTextureWithWidth:height:"></a>
	<h3 class="subsubtitle method-title">renderTextureWithWidth:height:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Creates a RenderTexture object with width and height in Points, pixel format is RGBA8888</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (id)renderTextureWithWidth:(int)<em>w</em> height:(int)<em>h</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>w</em></dt>
			<dd><p>Width of render target.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>h</em></dt>
			<dd><p>Height of render target.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>An initialized CCRenderTarget object.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/renderTextureWithWidth:height:pixelFormat:" title="renderTextureWithWidth:height:pixelFormat:"></a>
	<h3 class="subsubtitle method-title">renderTextureWithWidth:height:pixelFormat:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Creates a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (id)renderTextureWithWidth:(int)<em>w</em> height:(int)<em>h</em> pixelFormat:(CCTexturePixelFormat)<em>format</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>w</em></dt>
			<dd><p>Width of render target.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>h</em></dt>
			<dd><p>Height of render target.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>format</em></dt>
			<dd><p>Pixel format of render target.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>An initialized CCRenderTarget object.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/renderTextureWithWidth:height:pixelFormat:depthStencilFormat:" title="renderTextureWithWidth:height:pixelFormat:depthStencilFormat:"></a>
	<h3 class="subsubtitle method-title">renderTextureWithWidth:height:pixelFormat:depthStencilFormat:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (id)renderTextureWithWidth:(int)<em>w</em> height:(int)<em>h</em> pixelFormat:(CCTexturePixelFormat)<em>format</em> depthStencilFormat:(GLuint)<em>depthStencilFormat</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>w</em></dt>
			<dd><p>Width of render target.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>h</em></dt>
			<dd><p>Height of render target.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>format</em></dt>
			<dd><p>Pixel format of render target.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>depthStencilFormat</em></dt>
			<dd><p>Stencil format of render target.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>An initialized CCRenderTarget object.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
					
					<div class="section section-methods">
						<a title="Instance Methods" name="instance_methods"></a>
						<h2 class="subtitle subtitle-methods">Instance Methods</h2>
						
						<div class="section-method">
	<a name="//api/name/begin" title="begin"></a>
	<h3 class="subsubtitle method-title">begin</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Starts rendering to the texture whitout clearing the texture first.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)begin</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/beginWithClear:g:b:a:" title="beginWithClear:g:b:a:"></a>
	<h3 class="subsubtitle method-title">beginWithClear:g:b:a:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>starts rendering to the texture while clearing the texture first.
This is more efficient then calling -clear first and then <a href="#//api/name/begin">begin</a>.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)beginWithClear:(float)<em>r</em> g:(float)<em>g</em> b:(float)<em>b</em> a:(float)<em>a</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>r</em></dt>
			<dd><p>Red color.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>g</em></dt>
			<dd><p>Green color.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>b</em></dt>
			<dd><p>Blue color.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>a</em></dt>
			<dd><p>Alpha.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/beginWithClear:g:b:a:depth:" title="beginWithClear:g:b:a:depth:"></a>
	<h3 class="subsubtitle method-title">beginWithClear:g:b:a:depth:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>starts rendering to the texture while clearing the texture first.
This is more efficient then calling -clear first and then <a href="#//api/name/begin">begin</a>.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)beginWithClear:(float)<em>r</em> g:(float)<em>g</em> b:(float)<em>b</em> a:(float)<em>a</em> depth:(float)<em>depthValue</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>r</em></dt>
			<dd><p>Red color.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>g</em></dt>
			<dd><p>Green color.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>b</em></dt>
			<dd><p>Blue color.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>a</em></dt>
			<dd><p>Alpha.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>depthValue</em></dt>
			<dd><p>Depth value.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/beginWithClear:g:b:a:depth:stencil:" title="beginWithClear:g:b:a:depth:stencil:"></a>
	<h3 class="subsubtitle method-title">beginWithClear:g:b:a:depth:stencil:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>starts rendering to the texture while clearing the texture first.
This is more efficient then calling -clear first and then <a href="#//api/name/begin">begin</a>.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)beginWithClear:(float)<em>r</em> g:(float)<em>g</em> b:(float)<em>b</em> a:(float)<em>a</em> depth:(float)<em>depthValue</em> stencil:(int)<em>stencilValue</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>r</em></dt>
			<dd><p>Red color.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>g</em></dt>
			<dd><p>Green color.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>b</em></dt>
			<dd><p>Blue color.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>a</em></dt>
			<dd><p>Alpha.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>depthValue</em></dt>
			<dd><p>Depth value.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>stencilValue</em></dt>
			<dd><p>Stencil value.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/clear:g:b:a:" title="clear:g:b:a:"></a>
	<h3 class="subsubtitle method-title">clear:g:b:a:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Clears the texture with a color</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)clear:(float)<em>r</em> g:(float)<em>g</em> b:(float)<em>b</em> a:(float)<em>a</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>r</em></dt>
			<dd><p>Red color.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>g</em></dt>
			<dd><p>Green color.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>b</em></dt>
			<dd><p>Blue color.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>a</em></dt>
			<dd><p>Alpha.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/clearDepth:" title="clearDepth:"></a>
	<h3 class="subsubtitle method-title">clearDepth:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Clears the texture with a specified depth value.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)clearDepth:(float)<em>depthValue</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>depthValue</em></dt>
			<dd><p>Depth value.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/clearStencil:" title="clearStencil:"></a>
	<h3 class="subsubtitle method-title">clearStencil:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Clears the texture with a specified stencil value.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)clearStencil:(int)<em>stencilValue</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>stencilValue</em></dt>
			<dd><p>Stencil value.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/end" title="end"></a>
	<h3 class="subsubtitle method-title">end</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Ends grabbing</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)end</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/getUIImage" title="getUIImage"></a>
	<h3 class="subsubtitle method-title">getUIImage</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns an autoreleased UIImage from the texture</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (UIImage *)getUIImage</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/initWithWidth:height:pixelFormat:" title="initWithWidth:height:pixelFormat:"></a>
	<h3 class="subsubtitle method-title">initWithWidth:height:pixelFormat:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Initializes a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (id)initWithWidth:(int)<em>w</em> height:(int)<em>h</em> pixelFormat:(CCTexturePixelFormat)<em>format</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>w</em></dt>
			<dd><p>Width of render target.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>h</em></dt>
			<dd><p>Height of render target.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>format</em></dt>
			<dd><p>Pixel format of render target.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>An initialized CCRenderTarget object.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/initWithWidth:height:pixelFormat:depthStencilFormat:" title="initWithWidth:height:pixelFormat:depthStencilFormat:"></a>
	<h3 class="subsubtitle method-title">initWithWidth:height:pixelFormat:depthStencilFormat:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (id)initWithWidth:(int)<em>w</em> height:(int)<em>h</em> pixelFormat:(CCTexturePixelFormat)<em>format</em> depthStencilFormat:(GLuint)<em>depthStencilFormat</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>w</em></dt>
			<dd><p>Width of render target.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>h</em></dt>
			<dd><p>Height of render target.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>format</em></dt>
			<dd><p>Pixel format of render target.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>depthStencilFormat</em></dt>
			<dd><p>Stencil format of render target.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>An initialized CCRenderTarget object.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/saveToFile:" title="saveToFile:"></a>
	<h3 class="subsubtitle method-title">saveToFile:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Saves the texture into a file using JPEG format. The file will be saved in the Documents folder.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (BOOL)saveToFile:(NSString *)<em>name</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>name</em></dt>
			<dd><p>Filename to save image to.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>YES if the operation is successful.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/saveToFile:format:" title="saveToFile:format:"></a>
	<h3 class="subsubtitle method-title">saveToFile:format:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Saves the texture into a file. The format could be JPG or PNG. The file will be saved in the Documents folder.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (BOOL)saveToFile:(NSString *)<em>name</em> format:(CCRenderTextureImageFormat)<em>format</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>name</em></dt>
			<dd><p>Filename to save image to.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>format</em></dt>
			<dd><p>File format.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>YES if the operation is successful.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/saveToFilePath:" title="saveToFilePath:"></a>
	<h3 class="subsubtitle method-title">saveToFilePath:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Saves the texture into a file using JPEG format.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (BOOL)saveToFilePath:(NSString *)<em>filePath</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>filePath</em></dt>
			<dd><p>File path to save image to.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>YES if the operation was successful.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/saveToFilePath:format:" title="saveToFilePath:format:"></a>
	<h3 class="subsubtitle method-title">saveToFilePath:format:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Saves the texture into a file. The format could be JPG or PNG.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (BOOL)saveToFilePath:(NSString *)<em>filePath</em> format:(CCRenderTextureImageFormat)<em>format</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>filePath</em></dt>
			<dd><p>File path to save image to.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>format</em></dt>
			<dd><p>File format.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>YES if the operation was successful.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCRenderTexture.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
                    
                    
				</div>
				<div class="main-navigation navigation-bottom">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="footer">
					<hr />
					<div class="footer-copyright">
						<p><span class="copyright">&copy; 2014 3.2.0. All rights reserved. (Last updated: 2014-08-12)</span><br />
						
						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
						
					</div>
				</div>
			</div>
		</article>
		<script type="text/javascript">
			function jumpToChange()
			{
				window.location.hash = this.options[this.selectedIndex].value;
			}
			
			function toggleTOC()
			{
				var contents = document.getElementById('contents');
				var tocContainer = document.getElementById('tocContainer');
				
				if (this.getAttribute('class') == 'open')
				{
					this.setAttribute('class', '');
					contents.setAttribute('class', '');
					tocContainer.setAttribute('class', '');
					
					window.name = "hideTOC";
				}
				else
				{
					this.setAttribute('class', 'open');
					contents.setAttribute('class', 'isShowingTOC');
					tocContainer.setAttribute('class', 'isShowingTOC');
					
					window.name = "";
				}
				return false;
			}
			
			function toggleTOCEntryChildren(e)
			{
				e.stopPropagation();
				var currentClass = this.getAttribute('class');
				if (currentClass == 'children') {
					this.setAttribute('class', 'children open');
				}
				else if (currentClass == 'children open') {
					this.setAttribute('class', 'children');
				}
				return false;
			}
			
			function tocEntryClick(e)
			{
				e.stopPropagation();
				return true;
			}
			
			function init()
			{
				var selectElement = document.getElementById('jumpTo');
				selectElement.addEventListener('change', jumpToChange, false);
				
				var tocButton = document.getElementById('table_of_contents');
				tocButton.addEventListener('click', toggleTOC, false);
				
				var taskTreeItem = document.getElementById('task_treeitem');
				if (taskTreeItem.getElementsByTagName('li').length > 0)
				{
					taskTreeItem.setAttribute('class', 'children');
					taskTreeItem.firstChild.setAttribute('class', 'disclosure');
				}
				
				var tocList = document.getElementById('toc');
				
				var tocEntries = tocList.getElementsByTagName('li');
				for (var i = 0; i < tocEntries.length; i++) {
					tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
				}
				
				var tocLinks = tocList.getElementsByTagName('a');
				for (var i = 0; i < tocLinks.length; i++) {
					tocLinks[i].addEventListener('click', tocEntryClick, false);
				}
				
				if (window.name == "hideTOC") {
					toggleTOC.call(tocButton);
				}
			}
			
			window.onload = init;
			
			// If showing in Xcode, hide the TOC and Header
			if (navigator.userAgent.match(/xcode/i)) {
				document.getElementById("contents").className = "hideInXcode"
				document.getElementById("tocContainer").className = "hideInXcode"
				document.getElementById("top_header").className = "hideInXcode"
			}
			
		</script>
	</body>
</html>